'use strict'

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    const { INTEGER, DATE, TEXT, BOOLEAN } = Sequelize
    await queryInterface.createTable('photo_list', {
      id: {
        type: INTEGER(20).UNSIGNED,
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        comment: '照片列表id'
      },
      photo_url: {
        type: TEXT,
        allowNull: false,
        comment: '照片地址'
      },
      status: {
        type: BOOLEAN,
        values: [true, false],
        defaultValue: true,
        comment: '照片状态'
      },
      created_at: DATE,
      updated_at: DATE
    })
  },

  async down(queryInterface) {
    queryInterface.dropTable('photo_list')
  }
}
